package com.lemontree.common.baseEnum.user;

/**
 * @Author: YLBG-YCY-1325
 * @Description: 用户状态
 * @Date: 2017/6/27
 */
public enum UserState {
    FROZEN_USER(-2, "冻结用户"),
    CHECK_FAIL_USER(-1, "审核失败"),
    UN_CHECK_USER(0,"未审核"),
    WAIT_CHECK_USER(1, "待审核"),
    NORMAL_USER(2, "审核通过");

    private int code;
    private String desc;

    private UserState(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getName(int code) {
        for (UserState u : UserState.values()) {
            if (u.code == code) {
                return u.desc;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
